<?php 
function echo_loginbar($current_usr){
	if($current_usr) {
		echo '<a href="/u/'. $current_usr->id .'">'.$current_usr->name.'</a> <a href="/profile.php">设置</a> <a href="/logout.php">退出</a>';
	}else{		
		echo '<a href="#" onclick="javascript:location.href=\'/oauth.php?s=go\'"><img src="/resource/images/login_sina.png" width="140" height="28" /></a>';
	}
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title><?php echo $title ?></title>
<meta name="keywords" content="<?php echo $keywords ?>" />
<meta name="description" content="<?php echo $description ?>" />
<link href="/resource/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
  <div class="box">
    <div class="l left"><a href="/" title="回到首页"><img src="/resource/images/logo.png" alt="" /></a></div>
    <div class="r">
      <div id="nav" class="left">
       <div class="search_box round_15 left">
          <input type="text" class="text" value="请输入关键字" />
          <input type="button" class="btn round_15 l_black" value="Go" />
        </div>
      </div>
      <div class="right">        
        <div class="left pl10 pt5"><?php echo_loginbar($current_usr);?></div>
      </div>
    </div>
  </div>
</div>
<div id="content">
